package com.fastwire.carriere.hibernate.daoimpl;

import com.fastwire.carriere.dao.CodeDao;
import com.fastwire.carriere.dao.CrossConnectBandwidthDao;
import com.fastwire.carriere.dao.CrossConnectDao;
import com.fastwire.carriere.dao.DAOFactory;
import com.fastwire.carriere.dao.DiscoveryRecordDao;
import com.fastwire.carriere.dao.EquipmentDao;
import com.fastwire.carriere.dao.FDFRDao;
import com.fastwire.carriere.dao.NEDao;
import com.fastwire.carriere.dao.NetworkInventoryDao;
import com.fastwire.carriere.dao.OrderDao;
import com.fastwire.carriere.dao.ProtectionGroupDao;
import com.fastwire.carriere.dao.ScheduledTaskDao;
import com.fastwire.carriere.dao.SiteDao;
import com.fastwire.carriere.dao.SystemParameterDao;
import com.fastwire.carriere.dao.TPDao;
import com.fastwire.carriere.dao.TopologicalLinkDao;
import com.fastwire.carriere.dao.TrafficConditioningProfileDao;
import com.fastwire.carriere.dao.UserDao;
import com.fastwire.carriere.dao.UserSessionDao;
import com.fastwire.carriere.rad.dao.RadAlarmDao;
import com.fastwire.carriere.rad.dao.RadAlarmDaoImp;
import com.fastwire.carriere.rad.dao.RadDao;
import com.fastwire.carriere.rad.dao.RadDaoImp;
import com.fastwire.carriere.rad.dao.RadLogDao;
import com.fastwire.carriere.rad.dao.RadLogDaoImp;

// TODO: Auto-generated Javadoc
/**
 * The Class DAOFactoryImpl.
 */
public class DAOFactoryImpl extends DAOFactory {

	/** The ne dao. */
	private NEDao neDao = null;

	/** The equipment dao. */
	private EquipmentDao equipmentDao = null;

	/** The tp dao. */
	private TPDao tpDao = null;

	/** The cc dao. */
	private CrossConnectDao ccDao = null;

	/** The fdfr dao. */
	private FDFRDao fdfrDao = null;

	/** The topological link dao. */
	private TopologicalLinkDao topologicalLinkDao = null;

	/** The ccbandwidth dao. */
	private CrossConnectBandwidthDao ccbandwidthDao = null;

	/** The protection group dao. */
	private ProtectionGroupDao protectionGroupDao = null;

	/** The order dao. */
	private OrderDao orderDao = null;

	/** The discovery record dao. */
	private DiscoveryRecordDao discoveryRecordDao = null;

	/** The user dao. */
	private UserDao userDao = null;

	/** The code dao. */
	private CodeDao codeDao = null;

	/** The scheduled task dao. */
	private ScheduledTaskDao scheduledTaskDao = null;

	/** The traffic conditioning profile dao. */
	private TrafficConditioningProfileDao trafficConditioningProfileDao = null;

	private SystemParameterDao systemParameterDao;

	private NetworkInventoryDao networkInventoryDao;

	private UserSessionDao userSessionDao;

	private SiteDao siteDao;
	
	// added by Jun on 20120501
	private RadDao radDao = null;
	private RadAlarmDao alarmDao = null;
	private RadLogDao   logDao=null;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getNEDao()
	 */
	@Override
	public NEDao getNEDao() {
		if (neDao == null) {
			neDao = new NEDaoImpl();
		}
		return neDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getEquipmentDao()
	 */
	@Override
	public EquipmentDao getEquipmentDao() {
		if (equipmentDao == null) {
			equipmentDao = new EquipmentDaoImpl();
		}
		return equipmentDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getTPDao()
	 */
	@Override
	public TPDao getTPDao() {
		if (tpDao == null) {
			tpDao = new TPDaoImpl();
		}
		return tpDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getCrossConnectDao()
	 */
	@Override
	public CrossConnectDao getCrossConnectDao() {
		if (ccDao == null) {
			ccDao = new CrossConnectDaoImpl();
		}
		return ccDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getFdfrDao()
	 */
	@Override
	public FDFRDao getFdfrDao() {
		if (fdfrDao == null) {
			fdfrDao = new FDFRDaoImpl();
		}
		return fdfrDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getTopologicalLinkDao()
	 */
	@Override
	public TopologicalLinkDao getTopologicalLinkDao() {
		if (topologicalLinkDao == null) {
			topologicalLinkDao = new TopologicalLinkDaoImpl();
		}
		return topologicalLinkDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getCrossConnectBandwidthDao()
	 */
	@Override
	public CrossConnectBandwidthDao getCrossConnectBandwidthDao() {
		if (ccbandwidthDao == null) {
			ccbandwidthDao = new CrossConnectBandwidthDaoImpl();
		}

		return ccbandwidthDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getProtectionGroupDao()
	 */
	@Override
	public ProtectionGroupDao getProtectionGroupDao() {
		if (protectionGroupDao == null) {
			protectionGroupDao = new ProtectionGroupDaoImpl();
		}

		return protectionGroupDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getOrderDao()
	 */
	@Override
	public OrderDao getOrderDao() {
		if (orderDao == null) {
			orderDao = new OrderDaoImpl();
		}

		return orderDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getDiscoveryRecordDao()
	 */
	@Override
	public DiscoveryRecordDao getDiscoveryRecordDao() {
		if (discoveryRecordDao == null) {
			discoveryRecordDao = new DiscoveryRecordDaoImpl();
		}

		return discoveryRecordDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.fastwire.carriere.dao.DAOFactory#getTrafficConditioningProfileDao()
	 */
	@Override
	public TrafficConditioningProfileDao getTrafficConditioningProfileDao() {
		if (trafficConditioningProfileDao == null) {
			trafficConditioningProfileDao = new TrafficConditioningProfileDaoImpl();
		}

		return trafficConditioningProfileDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getUserDao()
	 */
	@Override
	public UserDao getUserDao() {
		if (userDao == null) {
			userDao = new UserDaoImpl();
		}
		return userDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getCodeDao()
	 */
	@Override
	public CodeDao getCodeDao() {
		if (codeDao == null) {
			codeDao = new CodeDaoImpl();
		}
		return codeDao;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.fastwire.carriere.dao.DAOFactory#getScheduledTask()
	 */
	@Override
	public ScheduledTaskDao getScheduledTask() {
		if (scheduledTaskDao == null) {
			scheduledTaskDao = new ScheduledTaskDaoImpl();
		}
		return scheduledTaskDao;
	}

	@Override
	public SystemParameterDao getSystemParameterDao() {
		if (systemParameterDao == null) {
			systemParameterDao = new SystemParameterDaoImpl();
		}
		return systemParameterDao;
	}

	@Override
	public NetworkInventoryDao getNetworkInventoryDao() {
		if (networkInventoryDao == null) {
			networkInventoryDao = new NetworkInventoryDaoImpl();
		}
		return networkInventoryDao;
	}

	@Override
	public UserSessionDao getUserSessionDao() {
		if (userSessionDao == null) {
			userSessionDao = new UserSessionDaoImpl();
		}
		return userSessionDao;
	}

	@Override
	public SiteDao getSiteDao() {
		if (siteDao == null) {
			siteDao = new SiteDaoImpl();
		}

		return siteDao;
	}

	
    // added by Jun on 20120501
    @Override
    public RadDao getRadDao()
    {
        if (null == radDao)
        {
            radDao = new RadDaoImp();
        }
        return radDao;
    }
    
    // added by Jun on 20120501
    @Override
    public RadAlarmDao getRadAlarmDao()
    {
        if (null == alarmDao)
        {
            alarmDao = new RadAlarmDaoImp();
        }
        return alarmDao;
    }
    
    // added by Jun on 20120501
    @Override
    public RadLogDao getRadLogDao()
    {
        if (null == logDao)
        {
            logDao = new RadLogDaoImp();
        }
        return logDao;
    }

}
